localVideo = document.getElementById("localVideo"); //本地视频
remoteVideo = document.getElementById("remoteVideo"); //远程接收视频


function startLocalVideo(){
	var stream = localStream;
	setVideo(localVideo,stream);
}

function stopLocalVideo(){
	localVideo.src="";
}

function setVideo(video,stream){
	if (video.mozSrcObject !== undefined) {
		video.mozSrcObject = stream;
	} else {
		video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
	};
	video.play();
}

navigator.getUserMedia = navigator.getUserMedia|| navigator.webkitGetUserMedia|| navigator.mozGetUserMedia|| navigator.msGetUserMedia;


navigator.getUserMedia({video:true,audio:true}, 
		function(stream){

			localStream = stream;

		},
		function(error) {
			return false;
		}); 